package config

import (
	"fmt"
	"os"

	v2 "gopkg.in/yaml.v2"
)

type ClientConfigType struct {
	Namesrv string `yaml:"namesrv" json:"namesrv"`
}

var ClientConfig ClientConfigType

func ClientConfigInit(path string) error {
	data, err := os.ReadFile(path)
	if err != nil {
		fmt.Println(err)
		return err
	}
	if err = v2.Unmarshal(data, &ClientConfig); err != nil {
		fmt.Println(err)
		return err
	}
	return nil
}
